import { IsNotEmpty, IsString, IsOptional, Length } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CreateVideoCategoryDto {
  @ApiProperty({
    description: '视频分类名称',
    example: '动作片',
    minLength: 2,
    maxLength: 50,
    required: true
  })
  @IsNotEmpty({ message: '分类名称不能为空' })
  @IsString({ message: '分类名称必须是字符串' })
  @Length(2, 50, { message: '分类名称长度在2-50个字符之间' })
  name: string;

  @ApiProperty({
    description: '视频分类描述',
    example: '包含各类动作、武打、特效场景的电影和短视频',
    required: false
  })
  @IsOptional()
  @IsString({ message: '分类描述必须是字符串' })
  description?: string;
}